# @Version : 1.0
# @Author  : 刘宇
# @File    : 18_str_while_for.py
# @Time    : 2025/10/13 14:26

str_b="hi-韩顺平教育"
# while循环遍历
index=0
while index<len(str_b):
    print(f"第{(index+1)}个元素 -> {str_b[index]}")
    # print(str_b[index])
    index+=1

print("-------------------------")
# for循环遍历
for ele in str_b:
    print(ele)